const Router = require('koa-router')

const registerRouter = new Router({prefix:'/register'})

const { verifyAuth } = require('../middleware/authMiddleware')
const {
  registerItem,
  getRegisterList,
  removeRegister,
  getRegistedItemsByAthleteId,
  removeRegisterItem,
  getRegistedItemsBySportId
} = require('../controller/registerController')


registerRouter.post('/:sportId/athlete/:athleteId',verifyAuth,registerItem)

registerRouter.post('/list', verifyAuth, getRegisterList)

registerRouter.delete('/:id', verifyAuth, removeRegister)

registerRouter.delete('/item/:sportId/:athleteId',verifyAuth,removeRegisterItem)

registerRouter.get('/:athleteId', verifyAuth, getRegistedItemsByAthleteId)

registerRouter.get('/athletes/:sportId',verifyAuth,getRegistedItemsBySportId)
module.exports = registerRouter